﻿<%@ Control Language="C#" ClassName="Shopping_Cart_Home" %>

<script runat="server">
    private ArrayList Shopping_Cart_List;
    private ArrayList Shopping_Cart_Html;
    private Boolean IsBindArry = false;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Shopping_Cart_List"] != null && Session["Shopping_Cart_Html"] != null)
        {
            Shopping_Cart_List = (ArrayList)Session["Shopping_Cart_List"];
            Shopping_Cart_Html = (ArrayList)Session["Shopping_Cart_Html"];
            IsBindArry = true;
        }
    }
</script>
    <script type="text/javascript" src="../static/lang/1.js"></script>
    <script type="text/javascript" src="../static/js/js.Home.js"></script>
    <script type="text/javascript" src="../static/js/Buy.js?<%=DateTime.Now %>"></script>
    <link href="../Pulgin/artDialog/skins/default.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../pulgin/artDialog/artDialog.min.js"></script>
<script type="text/javascript">
    /* 购物车信息绑定 */
    
    $(document).ready(function () {
        <%if (IsBindArry) for (int i = 0; i < Shopping_Cart_List.Count; i++) {  %>
        shopping_cart_list.push(<%=Shopping_Cart_List[i]%>);
        $("#Shopping-Cart-Home").fadeIn();
        html_value = $("#Shopping-Cart-Home #Item_List").append("<%=Shopping_Cart_Html[i]%>");
        <%}%>
        ItemCount();
    });
</script>
<div id="Shopping-Cart-Home">
    <h3><%=Lang.Show("ShoppingCart") %> <em><!--已订购的产品数量绑定--></em></h3>
    <div id="Item_List"></div>
    <button class="topay" onclick="ToPay()"><%=Lang.Show("ToPay") %></button>
</div>
<!-- 购物车列表的模板，包括.item标签 -->
<div id="Item_Template">
    <div class='item pay_item_{2}'><span>{0}</span><img src='{1}' /><button onclick='Cancel_Select({2})'><%=Lang.Show("Del") %></button></div>
</div>
